<?php
/**
* @version $Id: controller.php 18 2009-12-07 11:22:56Z truongnhan0311 $
* @author truongnhan0311
* @package	wrd component
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
	<script type="text/javascript">
	<!--
		function showOther(ex,id){
			vl = document.getElementById(ex).value;
		
			if(vl=="other"){
				document.getElementById(id).style.display = 'block';	
			}else{
				document.getElementById(id).style.display = 'none';
			}
		}
	//-->
	</script>
	<script type="text/javascript">
		// <![CDATA[
				jQuery.noConflict();
				jQuery(document).ready(function()
				{
					jQuery("#o_club").change(function () {
						var realvalues = new Array () ;
						var textvalues = new Array () ;
						var flag = 0 ;
						jQuery('#o_club option:selected').each(function(i, selected) {
							realvalues[i] = jQuery(selected).val();
						    textvalues[i] = jQuery(selected).text();
						    if(realvalues[i] == 'other'){
								flag = 1 ;
							}
						});
						if(flag == 0){
							jQuery("#fl_o_club").css('display','none') ;
						}else{
							jQuery("#fl_o_club").css('display','') ;
						}
			        });
					var realvalues = new Array () ;
					var textvalues = new Array () ;
					var flag = 0 ;
					jQuery('#o_club option:selected').each(function(i, selected) {
						realvalues[i] = jQuery(selected).val();
					    textvalues[i] = jQuery(selected).text();
					    if(realvalues[i] == 'other'){
							flag = 1 ;
						}
					});
					if(flag == 0){
						jQuery("#fl_o_club").css('display','none') ;
					}else{
						jQuery("#fl_o_club").css('display','') ;
					}	

					jQuery("#bation").change(function () {
						var realvalues1 = new Array () ;
						var textvalues1 = new Array () ;
						var flag1 = 0 ;
						jQuery('#bation option:selected').each(function(i, selected) {
							realvalues1[i] = jQuery(selected).val();
						    textvalues1[i] = jQuery(selected).text();
						    if(realvalues1[i] == 'other'){
								flag1 = 1 ;
							}
						});
						if(flag1 == 0){
							jQuery("#fl_o_bation").css('display','none') ;
						}else{
							jQuery("#fl_o_bation").css('display','') ;
						}
			        });
					var realvalues1 = new Array () ;
					var textvalues1 = new Array () ;
					var flag1 = 0 ;
					jQuery('#bation option:selected').each(function(i, selected) {
						realvalues1[i] = jQuery(selected).val();
					    textvalues1[i] = jQuery(selected).text();
					    if(realvalues1[i] == 'other'){
							flag1 = 1 ;
						}
					});
					if(flag1 == 0){
						jQuery("#fl_o_bation").css('display','none') ;
					}else{
						jQuery("#fl_o_bation").css('display','') ;
					}
                });
		// ]]>
	</script>
<div class="row">
<h2 class="all_reward_header"><?php echo JText::_('WRD_PROFILE_PROFILE')?></h2>
<div id="profile" class="twelve columns">
	<div style="clear: right ; height:0px;">&nbsp;</div>
	<table id="table1" width="100%" cellpadding="5" cellspacing="0" align="center">
		<tr>
			<td class="a-left title">
				<div><label for="title"><h2><?php echo JText::_('WRD_PROFILE_ACCOUNT_PREFERENCE')?></h2></label></div>
				<div class="contenttt">
                	<div class="left">
                        <strong style="color:#3E3061;"><?php echo $this->data->name_on_card; ?></strong><br>
                        <?php echo JText::_('WRD_PROFILE_ACCOUNT_NUM')?><strong style="color:#3E3061;"> <?php echo substr($this->data->member_id,1); ?></strong>
                        <label for="title">
                        	<?php echo JText::_('WRD_PROFILE_BALANCE')?>
                        	 : <span class='link_color'> 
                        	  <?php echo number_format($this->p_o_u->point,0,'.',',') ;?>
                        	<?php echo JText::_('WRD_PROFILE_POINTS')?> </span></label>
                    </div>
                    <div class="right">
                        <a href="<?php echo JRoute::_('index.php?option=com_wrd&view=profile&layout=myaccount&Itemid=119') ?>"><?php echo JText::_('WRD_PROFILE_VIEW_THE_SUMMARY_OF_YOUR_POINTS')?></a>
                    </div>
                </div>
			</td>
		</tr>
	</table>
    <table id="table2" cellpadding="0" cellspacing="0" >
    	<tr>	
    <?php	
    	if($this->data->user_id != 0)
    	{
    		$step = $this->data->step;
    		if($step > 1):
                $pointstep = WrdHelper::totalPointOfEachStep($step);
            endif;
    		
    		switch ($step){
    			case 1:
    			?>
                <td><div class="radius progress success"><span class="meter" style="width: 20%; float:left;"></span>
                	<span class="meterload"><?php echo JText::_('WRD_PROFILE_PLEASE_FILL_ALL_FILEDS_OF_THIS_STEP')?></span></div></td>
    			<?php
    			break;
    			case 2:
    			?>
                <td><div class="radius progress success"><span class="meter" style="width: 40%; float:left;"></span>
                	<span class="meterload"><?php echo JText::_('WRD_PROFILE_POINT_REWARDS_IS_COMMING_TO_YOUR_ACCOUNT_BY_THIS_STEP')?></span></div></td>
    			
    			<?php
    				break;
    			case 3:
    			?>
                <td><div class="radius progress success"><span class="meter" style="width: 60%; float:left;"></span>
                	<span class="meterload"><?php echo JText::_('WRD_PROFILE_POINTS_REWARDS')?></span></div></td>
    				
    			<?php
    				break;
    			case 4:
    			?>
                <td><div class="radius progress success"><span class="meter" style="width: 80%; float:left;"></span>
                	<span class="meterload"><?php echo JText::_('WRD_PROFILE_POINTS_AND_FINISH')?></span></div></td>
    			
    			<?php
    				break;
    			case 5:
    			?>
                <td>
                <div class="radius progress success">
                <span class="meter" id="meter100" style="width: 100%; float:left;">
                	<?php echo JText::_('WRD_PROFILE_CONGRATULATION_100_DONE')?>
                	
                </span>
                </div>
                </td>
    			<?php
    				break;
    		}
    	}
    ?>
    	</tr>
    </table>
	<form id="profile-registration" name="default_registration_form" class="form-validate" method="post" action="<?php echo JRoute::_('index.php?option=com_wrd&task=profile.save'); ?>">
	<table width="100%" id="default_registration_form" cellpadding="5" cellspacing="0" class="tblfrm">
		<tr>
			<td colspan="2" height="30">
				<dl class="tabs">
                  <dd><a href="<?php echo JRoute::_('index.php?option=com_wrd&view=profile&layout=default&id=1&Itemid=170') ?>">
                  	<?php echo JText::_('WRD_PROFILE_BASIC_INFOMATION') ?></a>
                  </dd>
                  <dd><a href="<?php echo JRoute::_('index.php?option=com_wrd&view=profile&layout=default&id=2&Itemid=170') ?>">
                  	<?php echo JText::_('WRD_PROFILE_PERSONAL_INFOMATION') ?></a>
                  </dd>
                  <dd><a href="<?php echo JRoute::_('index.php?option=com_wrd&view=profile&layout=default&id=3&Itemid=170') ?>">
                  	<?php echo JText::_('WRD_PROFILE_BIZ_CONTACT') ?></a>
                  </dd>
                  <dd class="active hide-for-small">
                  	<?php echo JText::_('WRD_PROFILE_PROFESSIONALISM') ?>
                  </dd>
                </dl>
			</td>
		</tr>
		<tr>
        <td>
      <table width="90%" align="center" id="table1_02">
		<div class="reg_tips" >
          	<div class="reg_tip_content">
				<?php echo JText::_('WRD_PROFILE_STEP4_FILLING_ALL_FIELDS_TIP')?>
			</div>
		</div>
        <tr>
			<td class="three key">
				<label for="title"><?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP4_'.$this->configField['education']['caption'])); ?></label>
			</td>
			<td>
				<?php echo $this->lists['education']; ?>
				<?php if(!empty($this->configField['c_city']['f_tip'])):?>
				<span class="hint"><?php echo $this->configField['education']['f_tip']; ?><span class="hint-pointer">&nbsp;</span></span>
				<?php endif ; ?>
			</td>
		</tr>
		<!-- Others Education -->
		<tr id="fl_o_education" style="<?php if(empty($this->data->o_education)){ echo 'display: none';}else{ echo 'display: block'; }?>">
			<td colspan="2">
				<table class="educationother">
					<tr>
						<td class="key">
							<label for="title"><?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP4_WRD_PROFILE_OTHER_EDUCATION')) ?></label>
						</td>
					</tr>
					<tr>
						<td>
							<input type="text" maxlength="37" size="37" value="<?php echo $this->data->o_education; ?>" id="o_education" name="o_education" title="<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP4_o_education_TIP')); ?>" class="has-tip tip-right noradius" />
							<?php if(!empty($this->configField['o_education']['f_tip'])):?>
							<span class="hint"><?php echo $this->configField['o_education']['f_tip']; ?><span class="hint-pointer">&nbsp;</span></span>
							<?php endif ;?>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<!-- End others education -->
		
		<tr>
			<td class="key">
				<label for="title"><?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP4_'.$this->configField['o_club']['caption'])); ?></label>
			</td>
			<td>
				<?php echo $this->lists['o_club']; ?>
				<?php if(!empty($this->configField['o_club']['f_tip'])):?>
				<span class="hint"><?php echo $this->configField['o_club']['f_tip']; ?><span class="hint-pointer">&nbsp;</span></span>
				<?php endif ;?>
			</td>
		</tr>
		<tr id="fl_o_club" style="<?php if(empty($this->data->o_o_clubs)){ echo 'display: none';}else{ echo 'display: block'; }?>">
			<td>
				<table>
					<tr>
						<td class="key" style="padding-left: 18px;">
							<label for="title"><?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP4_OTHER_CLUB_OTHER'.$this->configField['o_o_clubs']['caption'])); ?></label>
						</td>
					</tr>
					<tr>
						<td colspan="2" style="padding-left: 18px;">
							<input type="text" title="type" maxlength="37" size="37" value="<?php echo $this->data->o_o_clubs; ?>" id="o_o_clubs" name="o_o_clubs" class="o_o_clubs" />
							<?php if(!empty($this->configField['o_o_clubs']['f_tip'])):?>
							<span class="hint"><?php echo $this->configField['o_o_clubs']['f_tip']; ?><span class="hint-pointer">&nbsp;</span></span>
							<?php endif ;?>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td class="key">
				<label for="title"><?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP4_'.$this->configField['income']['caption'])); ?></label>
			</td>
			<td>
				<?php echo $this->lists['income']; ?>
				<?php if(!empty($this->configField['income']['f_tip'])):?>
				<span class="hint"><?php echo $this->configField['income']['f_tip']; ?><span class="hint-pointer">&nbsp;</span></span>
				<?php endif ; ?>
			</td>
		</tr>
		<tr>
			<td class="key">
				<label for="title"><?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP4_'.$this->configField['bation']['caption'])); ?></label>
			</td>
			<td>
				<?php echo $this->lists['bation']; ?>
				<?php if(!empty($this->configField['bation']['f_tip'])):?>
				<span class="hint"><?php echo $this->configField['bation']['f_tip']; ?><span class="hint-pointer">&nbsp;</span></span>
				<?php endif ; ?>
			</td>
		</tr>
		<!-- Others Education -->
		<tr id="fl_o_bation" style="<?php if(empty($this->data->o_bation)){ echo 'display: none';}else{ echo 'display: block'; }?>">
			<td>
				<table>
					<tr>
						<td class="key" style="padding-left: 18px;">
							<label for="title"><?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP4_BUSINESS_ASSOCIATION_OTHER'.$this->configField['o_bation']['caption'])); ?></label>
						</td>
					</tr>
					<tr>
						<td colspan="2" style="padding-left: 18px;">
							<input type="text" title="type" maxlength="37" size="37" value="<?php echo $this->data->o_bation; ?>" id="o_bation" name="o_bation" class="o_o_clubs" />
							<?php if(!empty($this->configField['o_bation']['f_tip'])):?>
							<span class="hint"><?php echo $this->configField['o_bation']['f_tip']; ?><span class="hint-pointer">&nbsp;</span></span>
							<?php endif ;?>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<!-- End others education -->
		
		<tr>
			<td colspan="2">
				<input type="submit" value="<?php echo JText::_('WRD_PROFILE_SAVE_CONTINUE') ?>" onclick="document.getElementById('continue').value = 1" id="save_and_continue" name="save_and_continue" class="button_save_and_continue bt" />
				<input type="submit" value="<?php echo JText::_('WRD_PROFILE_FINISH') ?>" id="finish" onclick="document.getElementById('continue').value = 0" name="finish" class="button_finish bt" />
			</td>
           
		</tr>
        </table>
        </td>
        </tr>
	</table>
	<input type="hidden" name="member_id" value="<?php echo $this->user_info->member_id; ?>" />
	<input type="hidden" name="profile" value="<?php echo $this->data->id ?>">
	<input type="hidden" name="option" value="com_wrd">
	<input type="hidden" name="task" value="profile.save">
	<input type="hidden" id="continue" name="continue" value="">
	<?php echo JHtml::_('form.token');?>
</form>
</div>
</div>